﻿// ----------------------------------------------------------------
// Description : 实体类,该文件由MyGeneration生成
// Author      : 
// Create date : 2010/7/21
// ----------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;

namespace ITOMMS.Entity
{
    /// <summary>
    ///	tbUser Entity
    ///	tbUser Entity用户表
    /// </summary>
    [Serializable]
    public class tbUserEntity : BaseEntity<tbUserEntity, int>
    {

        #region 私有成员

        private int _ID;
        private int _RoleGroup;
        private string _UserName;
        private string _PWD;
        private string _RealName;
        private string _sex;
        private int? _DepartmentID;
        private string _job;
        private int _State;
        private string _WorkNo;
        private string _Email;
        private string _Tel;
        private string _MSN;
        private string _QQ;
        private string _Email2;
        private string _MSN2;
        private string _QQ2;
        private string _Remark;
        private DateTime? _CreateDate;
        private int? _CreateBy;
        private DateTime? _ModifyDate;
        private int? _ModifyBy;
        private string _CompanyName;
        private string _LawPerson;
        private string _linkMan;
        private string _Mobile;
        private string _Phone;
        private string _FAX;
        private string _URL;
        private string _sendmsgAddress;
        private string _sendGoodsAddress;
        private string _ZIP;
        private DateTime? _LastLoginTime;
        private int? _LoginNum;
        private string _linkManMail;
        private string _公司地址;
        private string _公司邮箱;
        private string _服务项目;
        private string _公司规模;
        private string _公司网站;
        private string _负责人A;
        private string _负责人B;
        private string _负责人A电话;
        private string _负责人B电话;
        private string _负责人A手机;
        private string _负责人B手机;
        private DateTime? _工作时间;
        private bool? _五天八小时;
        private bool? _六天八小时;
        private DateTime? _上班时间;
        private DateTime? _下班时间;
        private string _台式电脑;
        private string _笔记本电脑;
        private string _服务器;
        private string _路由器;
        private string _集线器;
        private string _Moden;
        private string _交换机;
        private string _电话交换;
        private string _VPN;
        private string _邮件服务;
        private string _网站服务;
        private string _打印机;
        private string _复印机;
        private string _扫描仪;
        private string _其他要求;
        private string _五八小时服务;
        private int? _应急响应次数;
        private string _备注;
        private int? _负责人;
        private DateTime? _日期时间;
        private int? _AppendixID;
        private string _负责人A邮箱;
        private string _负责人B邮箱;
        private int _SEQNO;
        #endregion



        #region 默认( 空 ) 构造函数
        /// <summary>
        /// 默认构造函数
        /// </summary>
        public tbUserEntity()
        {
            _ID = 0;
            _RoleGroup = 0;
            _UserName = String.Empty;
            _PWD = String.Empty;
            _RealName = String.Empty;
            _sex = String.Empty;
            _DepartmentID = null;
            _job = String.Empty;
            _State = 0;
            _WorkNo = String.Empty;
            _Email = String.Empty;
            _Tel = String.Empty;
            _MSN = String.Empty;
            _QQ = String.Empty;
            _Email2 = String.Empty;
            _MSN2 = String.Empty;
            _QQ2 = String.Empty;
            _Remark = String.Empty;
            _CreateDate = null;
            _CreateBy = null;
            _ModifyDate = null;
            _ModifyBy = null;
            _CompanyName = String.Empty;
            _LawPerson = String.Empty;
            _linkMan = String.Empty;
            _Mobile = String.Empty;
            _Phone = String.Empty;
            _FAX = String.Empty;
            _URL = String.Empty;
            _sendmsgAddress = String.Empty;
            _sendGoodsAddress = String.Empty;
            _ZIP = String.Empty;
            _LastLoginTime = null;
            _LoginNum = null;
            _linkManMail = String.Empty;
            _公司地址 = String.Empty;
            _公司邮箱 = String.Empty;
            _服务项目 = String.Empty;
            _公司规模 = String.Empty;
            _公司网站 = String.Empty;
            _负责人A = String.Empty;
            _负责人B = String.Empty;
            _负责人A电话 = String.Empty;
            _负责人B电话 = String.Empty;
            _负责人A手机 = String.Empty;
            _负责人B手机 = String.Empty;
            _工作时间 = null;
            _五天八小时 = null;
            _六天八小时 = null;
            _上班时间 = null;
            _下班时间 = null;
            _台式电脑 = String.Empty;
            _笔记本电脑 = String.Empty;
            _服务器 = String.Empty;
            _路由器 = String.Empty;
            _集线器 = String.Empty;
            _Moden = String.Empty;
            _交换机 = String.Empty;
            _电话交换 = String.Empty;
            _VPN = String.Empty;
            _邮件服务 = String.Empty;
            _网站服务 = String.Empty;
            _打印机 = String.Empty;
            _复印机 = String.Empty;
            _扫描仪 = String.Empty;
            _其他要求 = String.Empty;
            _五八小时服务 = String.Empty;
            _应急响应次数 = null;
            _备注 = String.Empty;
            _负责人 = null;
            _日期时间 = null;
            _AppendixID = null;
            _负责人A邮箱 = String.Empty;
            _负责人B邮箱 = String.Empty;
            _SEQNO = 0;
        }
        #endregion

        #region 属性值校验

        /// <summary>
        /// 属性值校验
        /// </summary>
        public bool CheckValues()
        {
            bool bResult = true;
            string strError = "";

            if (_ID == 0)
            {
                bResult = false;
                strError += "\r\n 非空值不能为: " + _ID;
            }

            if (_RoleGroup == 0)
            {
                bResult = false;
                strError += "\r\n 非空值不能为: " + _RoleGroup;
            }

            if (_UserName == String.Empty)
            {
                bResult = false;
                strError += "\r\n 非空值不能为: " + _UserName;
            }

            if (_State == 0)
            {
                bResult = false;
                strError += "\r\n 非空值不能为: " + _State;
            }

            if (!bResult)
                throw new ArgumentOutOfRangeException(strError);
            return bResult;

        }

        #endregion




        #region Required Fields Only Constructor

        /// <summary>
        /// required (not null) fields only constructor
        /// </summary>
        public tbUserEntity(
        int para_ID, int para_RoleGroup, string para_UserName, int para_State)
            : this()
        {
            _ID = para_ID;
            _RoleGroup = para_RoleGroup;
            _UserName = para_UserName;
            _PWD = String.Empty;
            _RealName = String.Empty;
            _sex = String.Empty;
            _DepartmentID = null;
            _job = String.Empty;
            _State = para_State;
            _WorkNo = String.Empty;
            _Email = String.Empty;
            _Tel = String.Empty;
            _MSN = String.Empty;
            _QQ = String.Empty;
            _Email2 = String.Empty;
            _MSN2 = String.Empty;
            _QQ2 = String.Empty;
            _Remark = String.Empty;
            _CreateDate = null;
            _CreateBy = null;
            _ModifyDate = null;
            _ModifyBy = null;
            _CompanyName = String.Empty;
            _LawPerson = String.Empty;
            _linkMan = String.Empty;
            _Mobile = String.Empty;
            _Phone = String.Empty;
            _FAX = String.Empty;
            _URL = String.Empty;
            _sendmsgAddress = String.Empty;
            _sendGoodsAddress = String.Empty;
            _ZIP = String.Empty;
            _LastLoginTime = null;
            _LoginNum = null;
            _linkManMail = String.Empty;
            _公司地址 = String.Empty;
            _公司邮箱 = String.Empty;
            _服务项目 = String.Empty;
            _公司规模 = String.Empty;
            _公司网站 = String.Empty;
            _负责人A = String.Empty;
            _负责人B = String.Empty;
            _负责人A电话 = String.Empty;
            _负责人B电话 = String.Empty;
            _负责人A手机 = String.Empty;
            _负责人B手机 = String.Empty;
            _工作时间 = null;
            _五天八小时 = null;
            _六天八小时 = null;
            _上班时间 = null;
            _下班时间 = null;
            _台式电脑 = String.Empty;
            _笔记本电脑 = String.Empty;
            _服务器 = String.Empty;
            _路由器 = String.Empty;
            _集线器 = String.Empty;
            _Moden = String.Empty;
            _交换机 = String.Empty;
            _电话交换 = String.Empty;
            _VPN = String.Empty;
            _邮件服务 = String.Empty;
            _网站服务 = String.Empty;
            _打印机 = String.Empty;
            _复印机 = String.Empty;
            _扫描仪 = String.Empty;
            _其他要求 = String.Empty;
            _五八小时服务 = String.Empty;
            _应急响应次数 = null;
            _备注 = String.Empty;
            _负责人 = null;
            _日期时间 = null;
            _AppendixID = null;
            _负责人A邮箱 = String.Empty;
            _负责人B邮箱 = String.Empty;
        }
        #endregion


        #region 公有属性

        /// <summary>
        /// 行号，顺序号。系统默认的属性,对这个属性不要作操作.属性值在架构中已经处理
        /// </summary>
        public virtual int SEQNO
        {
            get { return _SEQNO; }
            set { _SEQNO = value; }
        }


        /// <summary>
        /// IDID
        /// </summary>		
        public virtual int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        /// <summary>
        /// RoleGroup管理员,技术员,客户
        /// </summary>		
        public virtual int RoleGroup
        {
            get { return _RoleGroup; }
            set { _RoleGroup = value; }
        }

        /// <summary>
        /// UserName用户名
        /// </summary>		
        public virtual string UserName
        {
            get { return _UserName; }
            set
            {

                if (value == null)
                    throw new ArgumentOutOfRangeException("Null value not allowed for UserName", value, "null");

                if (value != null)
                    if (value.Length > 30)
                        throw new ArgumentOutOfRangeException("Invalid value for UserName", value, value.ToString());

                _UserName = value;
            }
        }

        /// <summary>
        /// PWD密码
        /// </summary>		
        public virtual string PWD
        {
            get { return _PWD; }
            set
            {

                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for PWD", value, value.ToString());

                _PWD = value;
            }
        }

        /// <summary>
        /// RealName姓名
        /// </summary>		
        public virtual string RealName
        {
            get { return _RealName; }
            set
            {

                if (value != null)
                    if (value.Length > 30)
                        throw new ArgumentOutOfRangeException("Invalid value for RealName", value, value.ToString());

                _RealName = value;
            }
        }

        /// <summary>
        /// sex性别
        /// </summary>		
        public virtual string sex
        {
            get { return _sex; }
            set
            {

                if (value != null)
                    if (value.Length > 3)
                        throw new ArgumentOutOfRangeException("Invalid value for sex", value, value.ToString());

                _sex = value;
            }
        }

        /// <summary>
        /// DepartmentID部门ID
        /// </summary>		
        public virtual int? DepartmentID
        {
            get { return _DepartmentID; }
            set { _DepartmentID = value; }
        }

        /// <summary>
        /// job职位职称
        /// </summary>		
        public virtual string job
        {
            get { return _job; }
            set
            {

                if (value != null)
                    if (value.Length > 30)
                        throw new ArgumentOutOfRangeException("Invalid value for job", value, value.ToString());

                _job = value;
            }
        }

        /// <summary>
        /// State状态
        /// </summary>		
        public virtual int State
        {
            get { return _State; }
            set { _State = value; }
        }

        /// <summary>
        /// WorkNo工号
        /// </summary>		
        public virtual string WorkNo
        {
            get { return _WorkNo; }
            set
            {

                if (value != null)
                    if (value.Length > 30)
                        throw new ArgumentOutOfRangeException("Invalid value for WorkNo", value, value.ToString());

                _WorkNo = value;
            }
        }

        /// <summary>
        /// Email邮箱
        /// </summary>		
        public virtual string Email
        {
            get { return _Email; }
            set
            {

                if (value != null)
                    if (value.Length > 30)
                        throw new ArgumentOutOfRangeException("Invalid value for Email", value, value.ToString());

                _Email = value;
            }
        }

        /// <summary>
        /// Tel电话
        /// </summary>		
        public virtual string Tel
        {
            get { return _Tel; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for Tel", value, value.ToString());

                _Tel = value;
            }
        }

        /// <summary>
        /// MSNMSN
        /// </summary>		
        public virtual string MSN
        {
            get { return _MSN; }
            set
            {

                if (value != null)
                    if (value.Length > 30)
                        throw new ArgumentOutOfRangeException("Invalid value for MSN", value, value.ToString());

                _MSN = value;
            }
        }

        /// <summary>
        /// QQQQ
        /// </summary>		
        public virtual string QQ
        {
            get { return _QQ; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for QQ", value, value.ToString());

                _QQ = value;
            }
        }

        /// <summary>
        /// Email2
        /// </summary>		
        public virtual string Email2
        {
            get { return _Email2; }
            set
            {

                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Email2", value, value.ToString());

                _Email2 = value;
            }
        }

        /// <summary>
        /// MSN2
        /// </summary>		
        public virtual string MSN2
        {
            get { return _MSN2; }
            set
            {

                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for MSN2", value, value.ToString());

                _MSN2 = value;
            }
        }

        /// <summary>
        /// QQ2
        /// </summary>		
        public virtual string QQ2
        {
            get { return _QQ2; }
            set
            {

                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for QQ2", value, value.ToString());

                _QQ2 = value;
            }
        }

        /// <summary>
        /// Remark备注
        /// </summary>		
        public virtual string Remark
        {
            get { return _Remark; }
            set
            {

                if (value != null)
                    if (value.Length > 200)
                        throw new ArgumentOutOfRangeException("Invalid value for Remark", value, value.ToString());

                _Remark = value;
            }
        }

        /// <summary>
        /// CreateDate创建时间
        /// </summary>		
        public virtual DateTime? CreateDate
        {
            get { return _CreateDate; }
            set { _CreateDate = value; }
        }

        /// <summary>
        /// CreateBy创建人
        /// </summary>		
        public virtual int? CreateBy
        {
            get { return _CreateBy; }
            set { _CreateBy = value; }
        }

        /// <summary>
        /// ModifyDate修改时间
        /// </summary>		
        public virtual DateTime? ModifyDate
        {
            get { return _ModifyDate; }
            set { _ModifyDate = value; }
        }

        /// <summary>
        /// ModifyBy修改人
        /// </summary>		
        public virtual int? ModifyBy
        {
            get { return _ModifyBy; }
            set { _ModifyBy = value; }
        }

        /// <summary>
        /// CompanyName公司名称
        /// </summary>		
        public virtual string CompanyName
        {
            get { return _CompanyName; }
            set
            {

                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for CompanyName", value, value.ToString());

                _CompanyName = value;
            }
        }

        /// <summary>
        /// LawPerson法人代表
        /// </summary>		
        public virtual string LawPerson
        {
            get { return _LawPerson; }
            set
            {

                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for LawPerson", value, value.ToString());

                _LawPerson = value;
            }
        }

        /// <summary>
        /// linkMan联系人
        /// </summary>		
        public virtual string linkMan
        {
            get { return _linkMan; }
            set
            {

                if (value != null)
                    if (value.Length > 25)
                        throw new ArgumentOutOfRangeException("Invalid value for linkMan", value, value.ToString());

                _linkMan = value;
            }
        }

        /// <summary>
        /// Mobile手机号码
        /// </summary>		
        public virtual string Mobile
        {
            get { return _Mobile; }
            set
            {

                if (value != null)
                    if (value.Length > 15)
                        throw new ArgumentOutOfRangeException("Invalid value for Mobile", value, value.ToString());

                _Mobile = value;
            }
        }

        /// <summary>
        /// Phone公司电话
        /// </summary>		
        public virtual string Phone
        {
            get { return _Phone; }
            set
            {

                if (value != null)
                    if (value.Length > 15)
                        throw new ArgumentOutOfRangeException("Invalid value for Phone", value, value.ToString());

                _Phone = value;
            }
        }

        /// <summary>
        /// FAX公司传真
        /// </summary>		
        public virtual string FAX
        {
            get { return _FAX; }
            set
            {

                if (value != null)
                    if (value.Length > 15)
                        throw new ArgumentOutOfRangeException("Invalid value for FAX", value, value.ToString());

                _FAX = value;
            }
        }

        /// <summary>
        /// URL公司网址
        /// </summary>		
        public virtual string URL
        {
            get { return _URL; }
            set
            {

                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for URL", value, value.ToString());

                _URL = value;
            }
        }

        /// <summary>
        /// sendmsgAddress通讯地址
        /// </summary>		
        public virtual string sendmsgAddress
        {
            get { return _sendmsgAddress; }
            set
            {

                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for sendmsgAddress", value, value.ToString());

                _sendmsgAddress = value;
            }
        }

        /// <summary>
        /// sendGoodsAddress送货地址
        /// </summary>		
        public virtual string sendGoodsAddress
        {
            get { return _sendGoodsAddress; }
            set
            {

                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for sendGoodsAddress", value, value.ToString());

                _sendGoodsAddress = value;
            }
        }

        /// <summary>
        /// ZIP邮政编码
        /// </summary>		
        public virtual string ZIP
        {
            get { return _ZIP; }
            set
            {

                if (value != null)
                    if (value.Length > 10)
                        throw new ArgumentOutOfRangeException("Invalid value for ZIP", value, value.ToString());

                _ZIP = value;
            }
        }

        /// <summary>
        /// LastLoginTime上次登陆时间
        /// </summary>		
        public virtual DateTime? LastLoginTime
        {
            get { return _LastLoginTime; }
            set { _LastLoginTime = value; }
        }

        /// <summary>
        /// LoginNum登陆次数
        /// </summary>		
        public virtual int? LoginNum
        {
            get { return _LoginNum; }
            set { _LoginNum = value; }
        }

        /// <summary>
        /// linkManMail
        /// </summary>		
        public virtual string linkManMail
        {
            get { return _linkManMail; }
            set
            {

                if (value != null)
                    if (value.Length > 30)
                        throw new ArgumentOutOfRangeException("Invalid value for linkManMail", value, value.ToString());

                _linkManMail = value;
            }
        }

        /// <summary>
        /// 公司地址
        /// </summary>		
        public virtual string 公司地址
        {
            get { return _公司地址; }
            set
            {

                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for 公司地址", value, value.ToString());

                _公司地址 = value;
            }
        }

        /// <summary>
        /// 公司邮箱
        /// </summary>		
        public virtual string 公司邮箱
        {
            get { return _公司邮箱; }
            set
            {

                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for 公司邮箱", value, value.ToString());

                _公司邮箱 = value;
            }
        }

        /// <summary>
        /// 服务项目
        /// </summary>		
        public virtual string 服务项目
        {
            get { return _服务项目; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 服务项目", value, value.ToString());

                _服务项目 = value;
            }
        }

        /// <summary>
        /// 公司规模
        /// </summary>		
        public virtual string 公司规模
        {
            get { return _公司规模; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 公司规模", value, value.ToString());

                _公司规模 = value;
            }
        }

        /// <summary>
        /// 公司网站
        /// </summary>		
        public virtual string 公司网站
        {
            get { return _公司网站; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 公司网站", value, value.ToString());

                _公司网站 = value;
            }
        }

        /// <summary>
        /// 负责人A
        /// </summary>		
        public virtual string 负责人A
        {
            get { return _负责人A; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 负责人A", value, value.ToString());

                _负责人A = value;
            }
        }

        /// <summary>
        /// 负责人B
        /// </summary>		
        public virtual string 负责人B
        {
            get { return _负责人B; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 负责人B", value, value.ToString());

                _负责人B = value;
            }
        }

        /// <summary>
        /// 负责人A电话
        /// </summary>		
        public virtual string 负责人A电话
        {
            get { return _负责人A电话; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 负责人A电话", value, value.ToString());

                _负责人A电话 = value;
            }
        }

        /// <summary>
        /// 负责人B电话
        /// </summary>		
        public virtual string 负责人B电话
        {
            get { return _负责人B电话; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 负责人B电话", value, value.ToString());

                _负责人B电话 = value;
            }
        }

        /// <summary>
        /// 负责人A手机
        /// </summary>		
        public virtual string 负责人A手机
        {
            get { return _负责人A手机; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 负责人A手机", value, value.ToString());

                _负责人A手机 = value;
            }
        }

        /// <summary>
        /// 负责人B手机
        /// </summary>		
        public virtual string 负责人B手机
        {
            get { return _负责人B手机; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 负责人B手机", value, value.ToString());

                _负责人B手机 = value;
            }
        }

        /// <summary>
        /// 工作时间
        /// </summary>		
        public virtual DateTime? 工作时间
        {
            get { return _工作时间; }
            set { _工作时间 = value; }
        }

        /// <summary>
        /// 五天八小时
        /// </summary>		
        public virtual bool? 五天八小时
        {
            get { return _五天八小时; }
            set { _五天八小时 = value; }
        }

        /// <summary>
        /// 六天八小时
        /// </summary>		
        public virtual bool? 六天八小时
        {
            get { return _六天八小时; }
            set { _六天八小时 = value; }
        }

        /// <summary>
        /// 上班时间
        /// </summary>		
        public virtual DateTime? 上班时间
        {
            get { return _上班时间; }
            set { _上班时间 = value; }
        }

        /// <summary>
        /// 下班时间
        /// </summary>		
        public virtual DateTime? 下班时间
        {
            get { return _下班时间; }
            set { _下班时间 = value; }
        }

        /// <summary>
        /// 台式电脑
        /// </summary>		
        public virtual string 台式电脑
        {
            get { return _台式电脑; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 台式电脑", value, value.ToString());

                _台式电脑 = value;
            }
        }

        /// <summary>
        /// 笔记本电脑
        /// </summary>		
        public virtual string 笔记本电脑
        {
            get { return _笔记本电脑; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 笔记本电脑", value, value.ToString());

                _笔记本电脑 = value;
            }
        }

        /// <summary>
        /// 服务器
        /// </summary>		
        public virtual string 服务器
        {
            get { return _服务器; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 服务器", value, value.ToString());

                _服务器 = value;
            }
        }

        /// <summary>
        /// 路由器
        /// </summary>		
        public virtual string 路由器
        {
            get { return _路由器; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 路由器", value, value.ToString());

                _路由器 = value;
            }
        }

        /// <summary>
        /// 集线器
        /// </summary>		
        public virtual string 集线器
        {
            get { return _集线器; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 集线器", value, value.ToString());

                _集线器 = value;
            }
        }

        /// <summary>
        /// Moden
        /// </summary>		
        public virtual string Moden
        {
            get { return _Moden; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for Moden", value, value.ToString());

                _Moden = value;
            }
        }

        /// <summary>
        /// 交换机
        /// </summary>		
        public virtual string 交换机
        {
            get { return _交换机; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 交换机", value, value.ToString());

                _交换机 = value;
            }
        }

        /// <summary>
        /// 电话交换
        /// </summary>		
        public virtual string 电话交换
        {
            get { return _电话交换; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 电话交换", value, value.ToString());

                _电话交换 = value;
            }
        }

        /// <summary>
        /// VPN
        /// </summary>		
        public virtual string VPN
        {
            get { return _VPN; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for VPN", value, value.ToString());

                _VPN = value;
            }
        }

        /// <summary>
        /// 邮件服务
        /// </summary>		
        public virtual string 邮件服务
        {
            get { return _邮件服务; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 邮件服务", value, value.ToString());

                _邮件服务 = value;
            }
        }

        /// <summary>
        /// 网站服务
        /// </summary>		
        public virtual string 网站服务
        {
            get { return _网站服务; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 网站服务", value, value.ToString());

                _网站服务 = value;
            }
        }

        /// <summary>
        /// 打印机
        /// </summary>		
        public virtual string 打印机
        {
            get { return _打印机; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 打印机", value, value.ToString());

                _打印机 = value;
            }
        }

        /// <summary>
        /// 复印机
        /// </summary>		
        public virtual string 复印机
        {
            get { return _复印机; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 复印机", value, value.ToString());

                _复印机 = value;
            }
        }

        /// <summary>
        /// 扫描仪
        /// </summary>		
        public virtual string 扫描仪
        {
            get { return _扫描仪; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 扫描仪", value, value.ToString());

                _扫描仪 = value;
            }
        }

        /// <summary>
        /// 其他要求
        /// </summary>		
        public virtual string 其他要求
        {
            get { return _其他要求; }
            set
            {

                if (value != null)
                    if (value.Length > 20)
                        throw new ArgumentOutOfRangeException("Invalid value for 其他要求", value, value.ToString());

                _其他要求 = value;
            }
        }

        /// <summary>
        /// 五八小时服务
        /// </summary>		
        public virtual string 五八小时服务
        {
            get { return _五八小时服务; }
            set
            {

                if (value != null)
                    if (value.Length > 200)
                        throw new ArgumentOutOfRangeException("Invalid value for 五八小时服务", value, value.ToString());

                _五八小时服务 = value;
            }
        }

        /// <summary>
        /// 应急响应次数
        /// </summary>		
        public virtual int? 应急响应次数
        {
            get { return _应急响应次数; }
            set { _应急响应次数 = value; }
        }

        /// <summary>
        /// 备注
        /// </summary>		
        public virtual string 备注
        {
            get { return _备注; }
            set
            {

                if (value != null)
                    if (value.Length > 200)
                        throw new ArgumentOutOfRangeException("Invalid value for 备注", value, value.ToString());

                _备注 = value;
            }
        }

        /// <summary>
        /// 负责人
        /// </summary>		
        public virtual int? 负责人
        {
            get { return _负责人; }
            set { _负责人 = value; }
        }

        /// <summary>
        /// 日期时间
        /// </summary>		
        public virtual DateTime? 日期时间
        {
            get { return _日期时间; }
            set { _日期时间 = value; }
        }

        /// <summary>
        /// AppendixID
        /// </summary>		
        public virtual int? AppendixID
        {
            get { return _AppendixID; }
            set { _AppendixID = value; }
        }

        /// <summary>
        /// 负责人A邮箱
        /// </summary>		
        public virtual string 负责人A邮箱
        {
            get { return _负责人A邮箱; }
            set
            {

                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for 负责人A邮箱", value, value.ToString());

                _负责人A邮箱 = value;
            }
        }

        /// <summary>
        /// 负责人B邮箱
        /// </summary>		
        public virtual string 负责人B邮箱
        {
            get { return _负责人B邮箱; }
            set
            {

                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for 负责人B邮箱", value, value.ToString());

                _负责人B邮箱 = value;
            }
        }



        #endregion


        #region DAO操作


        /// <summary>
        /// 获取所有实体的列表
        /// </summary>
        /// <returns></returns>
        public override List<tbUserEntity> GetAll()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select [ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] from [tb_User] ");

            List<tbUserEntity> list = new List<tbUserEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                int seq = 0;
                while (dataReader.Read())
                {
                    seq++;
                    list.Add(ReaderBind(dataReader, seq));
                }
            }
            return list;
        }

        /// <summary>
        /// 获取所有实体的列表总行数
        /// </summary>
        /// <returns></returns>
        public override int GetTotalRecords()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("  select count([ID])  from [tb_User] ");

            Database db = GetDatabase();
            return (int)db.ExecuteScalar(CommandType.Text, strSql.ToString());
        }

        /// <summary>
        /// 获取所有实体的列表总行数
        /// </summary>
        /// <returns></returns>
        public override int GetTotalRecords(string sqlCondition)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("  select count([ID])  from [tb_User]  ");

            if (sqlCondition.Trim() != "")
            {
                strSql.Append(" where " + sqlCondition);
            }
            Database db = GetDatabase();
            return (int)db.ExecuteScalar(CommandType.Text, strSql.ToString());
        }


        /// <summary>
        /// 按条件查询,得到一页的对应的结果列表
        /// </summary>
        /// <param name="strWhere">条件</param>
        /// <param name="PageSize">每页大小</param>
        /// <param name="CurrentPageIndex">当前页码</param>
        /// <returns></returns>
        public override List<tbUserEntity> GetAllByQuery(string strWhere, int PageSize, int CurrentPageIndex)
        {
            StringBuilder strSql = new StringBuilder();
            if (strWhere.Contains("order".ToLower()))
            {
                throw new Exception("分页查询的sql条件中不能包括排序子句，请调用重载方法实现有条件的排序筛选");
            }

            strSql.Append("select top ").Append(PageSize).Append("  [ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] from [tb_User] where ");

            if (strWhere.Trim() != "")
            {
                strSql.Append("  " + strWhere + " and ");
            }
            strSql.Append(" ID not in ( ");
            strSql.Append(" select top ").Append(PageSize * (CurrentPageIndex - 1)).Append("  [ID] from [tb_User] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" ) ");

            List<tbUserEntity> list = new List<tbUserEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                int seq = PageSize * (CurrentPageIndex - 1);
                while (dataReader.Read())
                {
                    seq++;
                    list.Add(ReaderBind(dataReader, seq));
                }
            }
            return list;
        }


        /// <summary>
        /// 按条件查询,得到一页的对应的结果列表
        /// </summary>
        /// <param name="strWhere">条件</param>
        /// <param name="PageSize">每页大小</param>
        /// <param name="CurrentPageIndex">当前页码</param>
        /// <param name="strSort">ex:order by id desc</param>
        /// <returns></returns>
        public override List<tbUserEntity> GetAllByQuery(string strWhere, string strSort, int PageSize, int CurrentPageIndex)
        {
            StringBuilder strSql = new StringBuilder();
            if (strWhere.Contains("order".ToLower()))
            {
                throw new Exception("分页查询的sql条件中不能包括排序子句，请调用重载方法实现有条件的排序筛选");
            }

            strSql.Append("select top ").Append(PageSize).Append("  [ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] from [tb_User] where ");

            if (strWhere.Trim() != "")
            {
                strSql.Append("  " + strWhere + " and ");
            }
            strSql.Append(" ID not in ( ");
            strSql.Append(" select top ").Append(PageSize * (CurrentPageIndex - 1)).Append("  [ID] from [tb_User] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere + " ").Append(strSort);
            }
            strSql.Append(" ) ").Append(strSort);

            List<tbUserEntity> list = new List<tbUserEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                int seq = PageSize * (CurrentPageIndex - 1);
                while (dataReader.Read())
                {
                    seq++;
                    list.Add(ReaderBind(dataReader, seq));
                }
            }
            return list;
        }


        /// <summary>
        /// 按条件查询,得到对应的结果列表
        /// </summary>
        /// <param name="strWhere"></param>
        /// <returns></returns>
        public override List<tbUserEntity> GetAllByQuery(string strWhere)
        {
            strWhere = SQLInjectionFilter(strWhere);
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select [ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] from tb_User ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<tbUserEntity> list = new List<tbUserEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                int seq = 0;
                while (dataReader.Read())
                {
                    seq++;
                    list.Add(ReaderBind(dataReader, seq));
                }
            }
            return list;
        }



        /// <summary>
        /// 按条件查询,得到对应的结果列表
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="parameters">sql条件中的参数</param>
        /// <returns></returns>
        public override List<tbUserEntity> GetAllByQuery(string strWhere, List<IDataParameter> parameters)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select [ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] from [tb_User] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<tbUserEntity> list = new List<tbUserEntity>();
            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            foreach (IDataParameter sp in parameters)
            {
                db.AddInParameter(dbCommand, sp.ParameterName, sp.DbType, sp.Value);
            }

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                int seq = 0;
                while (dataReader.Read())
                {
                    seq++;
                    list.Add(ReaderBind(dataReader, seq));
                }
            }
            return list;
        }






        /// <summary>
        /// 获取按条件查询以后的结果列表的前指定rowNumber行记录
        /// </summary>
        /// <param name="strWhere">不带where关键字的SQL条件语句</param>
        /// <param name="rowNumber"></param>
        /// <returns></returns>
        public override List<tbUserEntity> GetAllByQuery(string strWhere, List<IDataParameter> parameters, int rowNumber)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select top ").Append(rowNumber).Append("  [ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] from [tb_User] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<tbUserEntity> list = new List<tbUserEntity>();
            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            foreach (IDataParameter sp in parameters)
            {
                db.AddInParameter(dbCommand, sp.ParameterName, sp.DbType, sp.Value);
            }

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                int seq = 0;
                while (dataReader.Read())
                {
                    seq++;
                    list.Add(ReaderBind(dataReader, seq));
                }
            }
            return list;
        }


        /// <summary>
        /// 获取按条件查询以后的结果列表的前指定rowNumber行记录
        /// </summary>
        /// <param name="strWhere">不带where关键字的SQL条件语句: AND AA=@AA</param>
        /// <param name="rowNumber"></param>
        /// <returns></returns>
        public override List<tbUserEntity> GetAllByQuery(string strWhere, int rowNumber)
        {
            strWhere = SQLInjectionFilter(strWhere);
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select top ").Append(rowNumber).Append("  [ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] from [tb_User] ");

            if (strWhere.Trim() != "")
            {
                strSql.Append(" where  " + strWhere);
            }
            List<tbUserEntity> list = new List<tbUserEntity>();
            Database db = GetDatabase();
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                int seq = 0;
                while (dataReader.Read())
                {
                    seq++;
                    list.Add(ReaderBind(dataReader, seq));
                }
            }
            return list;
        }







        /// <summary>
        /// 按主键查询对应的实体
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns></returns>
        public override tbUserEntity GetById(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select [ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] from [tb_User]  where ID= @ID ");

            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ID", DbType.Int32, id);
            tbUserEntity entity = null;
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    entity = ReaderBind(dataReader);
                }
            }
            return entity;

        }


        /// <summary>
        /// 保存实体
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override int Save()
        {

            if (this.ID == 0)
            {
                this.ID = GetMax("tb_User");
            }
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into  tb_User (");
            strSql.Append("[ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] )");
            strSql.Append(" values (");
            strSql.Append("@ID,@RoleGroup,@UserName,@PWD,@RealName,@sex,@DepartmentID,@job,@State,@WorkNo,@Email,@Tel,@MSN,@QQ,@Email2,@MSN2,@QQ2,@Remark,@CreateDate,@CreateBy,@ModifyDate,@ModifyBy,@CompanyName,@LawPerson,@linkMan,@Mobile,@Phone,@FAX,@URL,@sendmsgAddress,@sendGoodsAddress,@ZIP,@LastLoginTime,@LoginNum,@linkManMail,@公司地址,@公司邮箱,@服务项目,@公司规模,@公司网站,@负责人A,@负责人B,@负责人A电话,@负责人B电话,@负责人A手机,@负责人B手机,@工作时间,@五天八小时,@六天八小时,@上班时间,@下班时间,@台式电脑,@笔记本电脑,@服务器,@路由器,@集线器,@Moden,@交换机,@电话交换,@VPN,@邮件服务,@网站服务,@打印机,@复印机,@扫描仪,@其他要求,@五八小时服务,@应急响应次数,@备注,@负责人,@日期时间,@AppendixID,@负责人A邮箱,@负责人B邮箱)");

            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ID", DbType.Int32, this.ID);
            db.AddInParameter(dbCommand, "RoleGroup", DbType.Int32, this.RoleGroup);
            db.AddInParameter(dbCommand, "UserName", DbType.String, this.UserName);
            db.AddInParameter(dbCommand, "PWD", DbType.String, this.PWD);
            db.AddInParameter(dbCommand, "RealName", DbType.String, this.RealName);
            db.AddInParameter(dbCommand, "sex", DbType.String, this.sex);
            if (this.DepartmentID == null)
            {
                db.AddInParameter(dbCommand, "DepartmentID", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "DepartmentID", DbType.Int32, this.DepartmentID.Value);
            }
            db.AddInParameter(dbCommand, "job", DbType.String, this.job);
            db.AddInParameter(dbCommand, "State", DbType.Int32, this.State);
            db.AddInParameter(dbCommand, "WorkNo", DbType.String, this.WorkNo);
            db.AddInParameter(dbCommand, "Email", DbType.String, this.Email);
            db.AddInParameter(dbCommand, "Tel", DbType.String, this.Tel);
            db.AddInParameter(dbCommand, "MSN", DbType.String, this.MSN);
            db.AddInParameter(dbCommand, "QQ", DbType.String, this.QQ);
            db.AddInParameter(dbCommand, "Email2", DbType.String, this.Email2);
            db.AddInParameter(dbCommand, "MSN2", DbType.String, this.MSN2);
            db.AddInParameter(dbCommand, "QQ2", DbType.String, this.QQ2);
            db.AddInParameter(dbCommand, "Remark", DbType.String, this.Remark);
            if (this.CreateDate == null)
            {
                db.AddInParameter(dbCommand, "CreateDate", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "CreateDate", DbType.DateTime, this.CreateDate.Value);
            }
            if (this.CreateBy == null)
            {
                db.AddInParameter(dbCommand, "CreateBy", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "CreateBy", DbType.Int32, this.CreateBy.Value);
            }
            if (this.ModifyDate == null)
            {
                db.AddInParameter(dbCommand, "ModifyDate", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "ModifyDate", DbType.DateTime, this.ModifyDate.Value);
            }
            if (this.ModifyBy == null)
            {
                db.AddInParameter(dbCommand, "ModifyBy", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "ModifyBy", DbType.Int32, this.ModifyBy.Value);
            }
            db.AddInParameter(dbCommand, "CompanyName", DbType.String, this.CompanyName);
            db.AddInParameter(dbCommand, "LawPerson", DbType.String, this.LawPerson);
            db.AddInParameter(dbCommand, "linkMan", DbType.String, this.linkMan);
            db.AddInParameter(dbCommand, "Mobile", DbType.String, this.Mobile);
            db.AddInParameter(dbCommand, "Phone", DbType.String, this.Phone);
            db.AddInParameter(dbCommand, "FAX", DbType.String, this.FAX);
            db.AddInParameter(dbCommand, "URL", DbType.String, this.URL);
            db.AddInParameter(dbCommand, "sendmsgAddress", DbType.String, this.sendmsgAddress);
            db.AddInParameter(dbCommand, "sendGoodsAddress", DbType.String, this.sendGoodsAddress);
            db.AddInParameter(dbCommand, "ZIP", DbType.String, this.ZIP);
            if (this.LastLoginTime == null)
            {
                db.AddInParameter(dbCommand, "LastLoginTime", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "LastLoginTime", DbType.DateTime, this.LastLoginTime.Value);
            }
            if (this.LoginNum == null)
            {
                db.AddInParameter(dbCommand, "LoginNum", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "LoginNum", DbType.Int32, this.LoginNum.Value);
            }
            db.AddInParameter(dbCommand, "linkManMail", DbType.String, this.linkManMail);
            db.AddInParameter(dbCommand, "公司地址", DbType.String, this.公司地址);
            db.AddInParameter(dbCommand, "公司邮箱", DbType.String, this.公司邮箱);
            db.AddInParameter(dbCommand, "服务项目", DbType.String, this.服务项目);
            db.AddInParameter(dbCommand, "公司规模", DbType.String, this.公司规模);
            db.AddInParameter(dbCommand, "公司网站", DbType.String, this.公司网站);
            db.AddInParameter(dbCommand, "负责人A", DbType.String, this.负责人A);
            db.AddInParameter(dbCommand, "负责人B", DbType.String, this.负责人B);
            db.AddInParameter(dbCommand, "负责人A电话", DbType.String, this.负责人A电话);
            db.AddInParameter(dbCommand, "负责人B电话", DbType.String, this.负责人B电话);
            db.AddInParameter(dbCommand, "负责人A手机", DbType.String, this.负责人A手机);
            db.AddInParameter(dbCommand, "负责人B手机", DbType.String, this.负责人B手机);
            if (this.工作时间 == null)
            {
                db.AddInParameter(dbCommand, "工作时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "工作时间", DbType.DateTime, this.工作时间.Value);
            }
            if (this.五天八小时 == null)
            {
                db.AddInParameter(dbCommand, "五天八小时", DbType.Decimal, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "五天八小时", DbType.Decimal, this.五天八小时.Value);
            }
            if (this.六天八小时 == null)
            {
                db.AddInParameter(dbCommand, "六天八小时", DbType.Decimal, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "六天八小时", DbType.Decimal, this.六天八小时.Value);
            }
            if (this.上班时间 == null)
            {
                db.AddInParameter(dbCommand, "上班时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "上班时间", DbType.DateTime, this.上班时间.Value);
            }
            if (this.下班时间 == null)
            {
                db.AddInParameter(dbCommand, "下班时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "下班时间", DbType.DateTime, this.下班时间.Value);
            }
            db.AddInParameter(dbCommand, "台式电脑", DbType.String, this.台式电脑);
            db.AddInParameter(dbCommand, "笔记本电脑", DbType.String, this.笔记本电脑);
            db.AddInParameter(dbCommand, "服务器", DbType.String, this.服务器);
            db.AddInParameter(dbCommand, "路由器", DbType.String, this.路由器);
            db.AddInParameter(dbCommand, "集线器", DbType.String, this.集线器);
            db.AddInParameter(dbCommand, "Moden", DbType.String, this.Moden);
            db.AddInParameter(dbCommand, "交换机", DbType.String, this.交换机);
            db.AddInParameter(dbCommand, "电话交换", DbType.String, this.电话交换);
            db.AddInParameter(dbCommand, "VPN", DbType.String, this.VPN);
            db.AddInParameter(dbCommand, "邮件服务", DbType.String, this.邮件服务);
            db.AddInParameter(dbCommand, "网站服务", DbType.String, this.网站服务);
            db.AddInParameter(dbCommand, "打印机", DbType.String, this.打印机);
            db.AddInParameter(dbCommand, "复印机", DbType.String, this.复印机);
            db.AddInParameter(dbCommand, "扫描仪", DbType.String, this.扫描仪);
            db.AddInParameter(dbCommand, "其他要求", DbType.String, this.其他要求);
            db.AddInParameter(dbCommand, "五八小时服务", DbType.String, this.五八小时服务);
            if (this.应急响应次数 == null)
            {
                db.AddInParameter(dbCommand, "应急响应次数", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "应急响应次数", DbType.Int32, this.应急响应次数.Value);
            }
            db.AddInParameter(dbCommand, "备注", DbType.String, this.备注);
            if (this.负责人 == null)
            {
                db.AddInParameter(dbCommand, "负责人", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "负责人", DbType.Int32, this.负责人.Value);
            }
            if (this.日期时间 == null)
            {
                db.AddInParameter(dbCommand, "日期时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "日期时间", DbType.DateTime, this.日期时间.Value);
            }
            if (this.AppendixID == null)
            {
                db.AddInParameter(dbCommand, "AppendixID", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "AppendixID", DbType.Int32, this.AppendixID.Value);
            }
            db.AddInParameter(dbCommand, "负责人A邮箱", DbType.String, this.负责人A邮箱);
            db.AddInParameter(dbCommand, "负责人B邮箱", DbType.String, this.负责人B邮箱);

            return db.ExecuteNonQuery(dbCommand);


        }



        /// <summary>
        /// 保存实体
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override int Save(tbUserEntity entity)
        {

            if (entity.ID == 0)
            {
                entity.ID = GetMax("tb_User");
            }
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into  tb_User (");
            strSql.Append("[ID],[RoleGroup],[UserName],[PWD],[RealName],[sex],[DepartmentID],[job],[State],[WorkNo],[Email],[Tel],[MSN],[QQ],[Email2],[MSN2],[QQ2],[Remark],[CreateDate],[CreateBy],[ModifyDate],[ModifyBy],[CompanyName],[LawPerson],[linkMan],[Mobile],[Phone],[FAX],[URL],[sendmsgAddress],[sendGoodsAddress],[ZIP],[LastLoginTime],[LoginNum],[linkManMail],[公司地址],[公司邮箱],[服务项目],[公司规模],[公司网站],[负责人A],[负责人B],[负责人A电话],[负责人B电话],[负责人A手机],[负责人B手机],[工作时间],[五天八小时],[六天八小时],[上班时间],[下班时间],[台式电脑],[笔记本电脑],[服务器],[路由器],[集线器],[Moden],[交换机],[电话交换],[VPN],[邮件服务],[网站服务],[打印机],[复印机],[扫描仪],[其他要求],[五八小时服务],[应急响应次数],[备注],[负责人],[日期时间],[AppendixID],[负责人A邮箱],[负责人B邮箱] )");
            strSql.Append(" values (");
            strSql.Append("@ID,@RoleGroup,@UserName,@PWD,@RealName,@sex,@DepartmentID,@job,@State,@WorkNo,@Email,@Tel,@MSN,@QQ,@Email2,@MSN2,@QQ2,@Remark,@CreateDate,@CreateBy,@ModifyDate,@ModifyBy,@CompanyName,@LawPerson,@linkMan,@Mobile,@Phone,@FAX,@URL,@sendmsgAddress,@sendGoodsAddress,@ZIP,@LastLoginTime,@LoginNum,@linkManMail,@公司地址,@公司邮箱,@服务项目,@公司规模,@公司网站,@负责人A,@负责人B,@负责人A电话,@负责人B电话,@负责人A手机,@负责人B手机,@工作时间,@五天八小时,@六天八小时,@上班时间,@下班时间,@台式电脑,@笔记本电脑,@服务器,@路由器,@集线器,@Moden,@交换机,@电话交换,@VPN,@邮件服务,@网站服务,@打印机,@复印机,@扫描仪,@其他要求,@五八小时服务,@应急响应次数,@备注,@负责人,@日期时间,@AppendixID,@负责人A邮箱,@负责人B邮箱)");

            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ID", DbType.Int32, entity.ID);
            db.AddInParameter(dbCommand, "RoleGroup", DbType.Int32, entity.RoleGroup);
            db.AddInParameter(dbCommand, "UserName", DbType.String, entity.UserName);
            db.AddInParameter(dbCommand, "PWD", DbType.String, entity.PWD);
            db.AddInParameter(dbCommand, "RealName", DbType.String, entity.RealName);
            db.AddInParameter(dbCommand, "sex", DbType.String, entity.sex);
            if (entity.DepartmentID == null)
            {
                db.AddInParameter(dbCommand, "DepartmentID", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "DepartmentID", DbType.Int32, entity.DepartmentID.Value);
            }
            db.AddInParameter(dbCommand, "job", DbType.String, entity.job);
            db.AddInParameter(dbCommand, "State", DbType.Int32, entity.State);
            db.AddInParameter(dbCommand, "WorkNo", DbType.String, entity.WorkNo);
            db.AddInParameter(dbCommand, "Email", DbType.String, entity.Email);
            db.AddInParameter(dbCommand, "Tel", DbType.String, entity.Tel);
            db.AddInParameter(dbCommand, "MSN", DbType.String, entity.MSN);
            db.AddInParameter(dbCommand, "QQ", DbType.String, entity.QQ);
            db.AddInParameter(dbCommand, "Email2", DbType.String, entity.Email2);
            db.AddInParameter(dbCommand, "MSN2", DbType.String, entity.MSN2);
            db.AddInParameter(dbCommand, "QQ2", DbType.String, entity.QQ2);
            db.AddInParameter(dbCommand, "Remark", DbType.String, entity.Remark);
            if (entity.CreateDate == null)
            {
                db.AddInParameter(dbCommand, "CreateDate", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "CreateDate", DbType.DateTime, entity.CreateDate.Value);
            }
            if (entity.CreateBy == null)
            {
                db.AddInParameter(dbCommand, "CreateBy", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "CreateBy", DbType.Int32, entity.CreateBy.Value);
            }
            if (entity.ModifyDate == null)
            {
                db.AddInParameter(dbCommand, "ModifyDate", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "ModifyDate", DbType.DateTime, entity.ModifyDate.Value);
            }
            if (entity.ModifyBy == null)
            {
                db.AddInParameter(dbCommand, "ModifyBy", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "ModifyBy", DbType.Int32, entity.ModifyBy.Value);
            }
            db.AddInParameter(dbCommand, "CompanyName", DbType.String, entity.CompanyName);
            db.AddInParameter(dbCommand, "LawPerson", DbType.String, entity.LawPerson);
            db.AddInParameter(dbCommand, "linkMan", DbType.String, entity.linkMan);
            db.AddInParameter(dbCommand, "Mobile", DbType.String, entity.Mobile);
            db.AddInParameter(dbCommand, "Phone", DbType.String, entity.Phone);
            db.AddInParameter(dbCommand, "FAX", DbType.String, entity.FAX);
            db.AddInParameter(dbCommand, "URL", DbType.String, entity.URL);
            db.AddInParameter(dbCommand, "sendmsgAddress", DbType.String, entity.sendmsgAddress);
            db.AddInParameter(dbCommand, "sendGoodsAddress", DbType.String, entity.sendGoodsAddress);
            db.AddInParameter(dbCommand, "ZIP", DbType.String, entity.ZIP);
            if (entity.LastLoginTime == null)
            {
                db.AddInParameter(dbCommand, "LastLoginTime", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "LastLoginTime", DbType.DateTime, entity.LastLoginTime.Value);
            }
            if (entity.LoginNum == null)
            {
                db.AddInParameter(dbCommand, "LoginNum", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "LoginNum", DbType.Int32, entity.LoginNum.Value);
            }
            db.AddInParameter(dbCommand, "linkManMail", DbType.String, entity.linkManMail);
            db.AddInParameter(dbCommand, "公司地址", DbType.String, entity.公司地址);
            db.AddInParameter(dbCommand, "公司邮箱", DbType.String, entity.公司邮箱);
            db.AddInParameter(dbCommand, "服务项目", DbType.String, entity.服务项目);
            db.AddInParameter(dbCommand, "公司规模", DbType.String, entity.公司规模);
            db.AddInParameter(dbCommand, "公司网站", DbType.String, entity.公司网站);
            db.AddInParameter(dbCommand, "负责人A", DbType.String, entity.负责人A);
            db.AddInParameter(dbCommand, "负责人B", DbType.String, entity.负责人B);
            db.AddInParameter(dbCommand, "负责人A电话", DbType.String, entity.负责人A电话);
            db.AddInParameter(dbCommand, "负责人B电话", DbType.String, entity.负责人B电话);
            db.AddInParameter(dbCommand, "负责人A手机", DbType.String, entity.负责人A手机);
            db.AddInParameter(dbCommand, "负责人B手机", DbType.String, entity.负责人B手机);
            if (entity.工作时间 == null)
            {
                db.AddInParameter(dbCommand, "工作时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "工作时间", DbType.DateTime, entity.工作时间.Value);
            }
            if (entity.五天八小时 == null)
            {
                db.AddInParameter(dbCommand, "五天八小时", DbType.Decimal, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "五天八小时", DbType.Decimal, entity.五天八小时.Value);
            }
            if (entity.六天八小时 == null)
            {
                db.AddInParameter(dbCommand, "六天八小时", DbType.Decimal, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "六天八小时", DbType.Decimal, entity.六天八小时.Value);
            }
            if (entity.上班时间 == null)
            {
                db.AddInParameter(dbCommand, "上班时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "上班时间", DbType.DateTime, entity.上班时间.Value);
            }
            if (entity.下班时间 == null)
            {
                db.AddInParameter(dbCommand, "下班时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "下班时间", DbType.DateTime, entity.下班时间.Value);
            }
            db.AddInParameter(dbCommand, "台式电脑", DbType.String, entity.台式电脑);
            db.AddInParameter(dbCommand, "笔记本电脑", DbType.String, entity.笔记本电脑);
            db.AddInParameter(dbCommand, "服务器", DbType.String, entity.服务器);
            db.AddInParameter(dbCommand, "路由器", DbType.String, entity.路由器);
            db.AddInParameter(dbCommand, "集线器", DbType.String, entity.集线器);
            db.AddInParameter(dbCommand, "Moden", DbType.String, entity.Moden);
            db.AddInParameter(dbCommand, "交换机", DbType.String, entity.交换机);
            db.AddInParameter(dbCommand, "电话交换", DbType.String, entity.电话交换);
            db.AddInParameter(dbCommand, "VPN", DbType.String, entity.VPN);
            db.AddInParameter(dbCommand, "邮件服务", DbType.String, entity.邮件服务);
            db.AddInParameter(dbCommand, "网站服务", DbType.String, entity.网站服务);
            db.AddInParameter(dbCommand, "打印机", DbType.String, entity.打印机);
            db.AddInParameter(dbCommand, "复印机", DbType.String, entity.复印机);
            db.AddInParameter(dbCommand, "扫描仪", DbType.String, entity.扫描仪);
            db.AddInParameter(dbCommand, "其他要求", DbType.String, entity.其他要求);
            db.AddInParameter(dbCommand, "五八小时服务", DbType.String, entity.五八小时服务);
            if (entity.应急响应次数 == null)
            {
                db.AddInParameter(dbCommand, "应急响应次数", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "应急响应次数", DbType.Int32, entity.应急响应次数.Value);
            }
            db.AddInParameter(dbCommand, "备注", DbType.String, entity.备注);
            if (entity.负责人 == null)
            {
                db.AddInParameter(dbCommand, "负责人", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "负责人", DbType.Int32, entity.负责人.Value);
            }
            if (entity.日期时间 == null)
            {
                db.AddInParameter(dbCommand, "日期时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "日期时间", DbType.DateTime, entity.日期时间.Value);
            }
            if (entity.AppendixID == null)
            {
                db.AddInParameter(dbCommand, "AppendixID", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "AppendixID", DbType.Int32, entity.AppendixID.Value);
            }
            db.AddInParameter(dbCommand, "负责人A邮箱", DbType.String, entity.负责人A邮箱);
            db.AddInParameter(dbCommand, "负责人B邮箱", DbType.String, entity.负责人B邮箱);

            return db.ExecuteNonQuery(dbCommand);


        }


        /// <summary>
        /// 保存或者更新(如果传入的实体主键为空则保存,否则做更新操作)
        /// </summary>
        /// <param name="entity">传入的实体</param>
        /// <returns>影响的行数</returns>
        public override int SaveOrUpdate(tbUserEntity entity)
        {

            if (entity.ID == 0)
            {
                if (Save(entity) > 0)
                {
                    return 1;
                }
                else
                {
                    return 0;
                }
            }
            else
            {
                return Update(entity);
            }
        }

        /// <summary>
        /// 保存或者更新(如果传入的实体主键为空则保存,否则做更新操作)
        /// </summary>
        /// <param name="entity">传入的实体</param>
        /// <returns>影响的行数</returns>
        public override int SaveOrUpdate()
        {

            if (this.ID == 0)
            {
                if (Save() > 0)
                {
                    return 1;
                }
                else
                {
                    return 0;
                }
            }
            else
            {
                return Update();
            }
        }

        /// <summary>
        /// 是否存在对应主键ID的记录
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public override bool IsExist(int ID)
        {
            Database db = GetDatabase();
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from tb_User where ID=@ID ");

            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ID", DbType.Int32, ID);//这里为ID是因为原有代码把主键都变成了ID.
            int cmdresult;
            object obj = db.ExecuteScalar(dbCommand);
            if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }


        /// <summary>
        /// 删除对应的实体
        /// </summary>
        /// <param name="entity"></param>
        public override int Delete(tbUserEntity entity)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete tb_User ");
            strSql.Append(" where ID=@ID ");
            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ID", DbType.Int32, entity.ID);
            return db.ExecuteNonQuery(dbCommand);
        }

        /// <summary>
        /// 删除主键ID对应的记录
        /// </summary>
        /// <param name="id"></param>
        public override int Delete(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete tb_User ");
            strSql.Append(" where ID=@ID ");
            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ID", DbType.Int32, id);
            return db.ExecuteNonQuery(dbCommand);
        }


        /// <summary>
        /// 更新一条数据
        /// </summary>
        public override int Update()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update tb_User set ");
            strSql.Append("[ID]=@ID,[RoleGroup]=@RoleGroup,[UserName]=@UserName,[PWD]=@PWD,[RealName]=@RealName,[sex]=@sex,[DepartmentID]=@DepartmentID,[job]=@job,[State]=@State,[WorkNo]=@WorkNo,[Email]=@Email,[Tel]=@Tel,[MSN]=@MSN,[QQ]=@QQ,[Email2]=@Email2,[MSN2]=@MSN2,[QQ2]=@QQ2,[Remark]=@Remark,[CreateDate]=@CreateDate,[CreateBy]=@CreateBy,[ModifyDate]=@ModifyDate,[ModifyBy]=@ModifyBy,[CompanyName]=@CompanyName,[LawPerson]=@LawPerson,[linkMan]=@linkMan,[Mobile]=@Mobile,[Phone]=@Phone,[FAX]=@FAX,[URL]=@URL,[sendmsgAddress]=@sendmsgAddress,[sendGoodsAddress]=@sendGoodsAddress,[ZIP]=@ZIP,[LastLoginTime]=@LastLoginTime,[LoginNum]=@LoginNum,[linkManMail]=@linkManMail,[公司地址]=@公司地址,[公司邮箱]=@公司邮箱,[服务项目]=@服务项目,[公司规模]=@公司规模,[公司网站]=@公司网站,[负责人A]=@负责人A,[负责人B]=@负责人B,[负责人A电话]=@负责人A电话,[负责人B电话]=@负责人B电话,[负责人A手机]=@负责人A手机,[负责人B手机]=@负责人B手机,[工作时间]=@工作时间,[五天八小时]=@五天八小时,[六天八小时]=@六天八小时,[上班时间]=@上班时间,[下班时间]=@下班时间,[台式电脑]=@台式电脑,[笔记本电脑]=@笔记本电脑,[服务器]=@服务器,[路由器]=@路由器,[集线器]=@集线器,[Moden]=@Moden,[交换机]=@交换机,[电话交换]=@电话交换,[VPN]=@VPN,[邮件服务]=@邮件服务,[网站服务]=@网站服务,[打印机]=@打印机,[复印机]=@复印机,[扫描仪]=@扫描仪,[其他要求]=@其他要求,[五八小时服务]=@五八小时服务,[应急响应次数]=@应急响应次数,[备注]=@备注,[负责人]=@负责人,[日期时间]=@日期时间,[AppendixID]=@AppendixID,[负责人A邮箱]=@负责人A邮箱,[负责人B邮箱]=@负责人B邮箱 ");

            strSql.Append(" where ID=@ID ");
            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ID", DbType.Int32, this.ID);
            db.AddInParameter(dbCommand, "RoleGroup", DbType.Int32, this.RoleGroup);
            db.AddInParameter(dbCommand, "UserName", DbType.String, this.UserName);
            db.AddInParameter(dbCommand, "PWD", DbType.String, this.PWD);
            db.AddInParameter(dbCommand, "RealName", DbType.String, this.RealName);
            db.AddInParameter(dbCommand, "sex", DbType.String, this.sex);
            if (this.DepartmentID == null)
            {
                db.AddInParameter(dbCommand, "DepartmentID", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "DepartmentID", DbType.Int32, this.DepartmentID.Value);
            }
            db.AddInParameter(dbCommand, "job", DbType.String, this.job);
            db.AddInParameter(dbCommand, "State", DbType.Int32, this.State);
            db.AddInParameter(dbCommand, "WorkNo", DbType.String, this.WorkNo);
            db.AddInParameter(dbCommand, "Email", DbType.String, this.Email);
            db.AddInParameter(dbCommand, "Tel", DbType.String, this.Tel);
            db.AddInParameter(dbCommand, "MSN", DbType.String, this.MSN);
            db.AddInParameter(dbCommand, "QQ", DbType.String, this.QQ);
            db.AddInParameter(dbCommand, "Email2", DbType.String, this.Email2);
            db.AddInParameter(dbCommand, "MSN2", DbType.String, this.MSN2);
            db.AddInParameter(dbCommand, "QQ2", DbType.String, this.QQ2);
            db.AddInParameter(dbCommand, "Remark", DbType.String, this.Remark);
            if (this.CreateDate == null)
            {
                db.AddInParameter(dbCommand, "CreateDate", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "CreateDate", DbType.DateTime, this.CreateDate.Value);
            }
            if (this.CreateBy == null)
            {
                db.AddInParameter(dbCommand, "CreateBy", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "CreateBy", DbType.Int32, this.CreateBy.Value);
            }
            if (this.ModifyDate == null)
            {
                db.AddInParameter(dbCommand, "ModifyDate", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "ModifyDate", DbType.DateTime, this.ModifyDate.Value);
            }
            if (this.ModifyBy == null)
            {
                db.AddInParameter(dbCommand, "ModifyBy", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "ModifyBy", DbType.Int32, this.ModifyBy.Value);
            }
            db.AddInParameter(dbCommand, "CompanyName", DbType.String, this.CompanyName);
            db.AddInParameter(dbCommand, "LawPerson", DbType.String, this.LawPerson);
            db.AddInParameter(dbCommand, "linkMan", DbType.String, this.linkMan);
            db.AddInParameter(dbCommand, "Mobile", DbType.String, this.Mobile);
            db.AddInParameter(dbCommand, "Phone", DbType.String, this.Phone);
            db.AddInParameter(dbCommand, "FAX", DbType.String, this.FAX);
            db.AddInParameter(dbCommand, "URL", DbType.String, this.URL);
            db.AddInParameter(dbCommand, "sendmsgAddress", DbType.String, this.sendmsgAddress);
            db.AddInParameter(dbCommand, "sendGoodsAddress", DbType.String, this.sendGoodsAddress);
            db.AddInParameter(dbCommand, "ZIP", DbType.String, this.ZIP);
            if (this.LastLoginTime == null)
            {
                db.AddInParameter(dbCommand, "LastLoginTime", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "LastLoginTime", DbType.DateTime, this.LastLoginTime.Value);
            }
            if (this.LoginNum == null)
            {
                db.AddInParameter(dbCommand, "LoginNum", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "LoginNum", DbType.Int32, this.LoginNum.Value);
            }
            db.AddInParameter(dbCommand, "linkManMail", DbType.String, this.linkManMail);
            db.AddInParameter(dbCommand, "公司地址", DbType.String, this.公司地址);
            db.AddInParameter(dbCommand, "公司邮箱", DbType.String, this.公司邮箱);
            db.AddInParameter(dbCommand, "服务项目", DbType.String, this.服务项目);
            db.AddInParameter(dbCommand, "公司规模", DbType.String, this.公司规模);
            db.AddInParameter(dbCommand, "公司网站", DbType.String, this.公司网站);
            db.AddInParameter(dbCommand, "负责人A", DbType.String, this.负责人A);
            db.AddInParameter(dbCommand, "负责人B", DbType.String, this.负责人B);
            db.AddInParameter(dbCommand, "负责人A电话", DbType.String, this.负责人A电话);
            db.AddInParameter(dbCommand, "负责人B电话", DbType.String, this.负责人B电话);
            db.AddInParameter(dbCommand, "负责人A手机", DbType.String, this.负责人A手机);
            db.AddInParameter(dbCommand, "负责人B手机", DbType.String, this.负责人B手机);
            if (this.工作时间 == null)
            {
                db.AddInParameter(dbCommand, "工作时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "工作时间", DbType.DateTime, this.工作时间.Value);
            }
            if (this.五天八小时 == null)
            {
                db.AddInParameter(dbCommand, "五天八小时", DbType.Decimal, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "五天八小时", DbType.Decimal, this.五天八小时.Value);
            }
            if (this.六天八小时 == null)
            {
                db.AddInParameter(dbCommand, "六天八小时", DbType.Decimal, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "六天八小时", DbType.Decimal, this.六天八小时.Value);
            }
            if (this.上班时间 == null)
            {
                db.AddInParameter(dbCommand, "上班时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "上班时间", DbType.DateTime, this.上班时间.Value);
            }
            if (this.下班时间 == null)
            {
                db.AddInParameter(dbCommand, "下班时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "下班时间", DbType.DateTime, this.下班时间.Value);
            }
            db.AddInParameter(dbCommand, "台式电脑", DbType.String, this.台式电脑);
            db.AddInParameter(dbCommand, "笔记本电脑", DbType.String, this.笔记本电脑);
            db.AddInParameter(dbCommand, "服务器", DbType.String, this.服务器);
            db.AddInParameter(dbCommand, "路由器", DbType.String, this.路由器);
            db.AddInParameter(dbCommand, "集线器", DbType.String, this.集线器);
            db.AddInParameter(dbCommand, "Moden", DbType.String, this.Moden);
            db.AddInParameter(dbCommand, "交换机", DbType.String, this.交换机);
            db.AddInParameter(dbCommand, "电话交换", DbType.String, this.电话交换);
            db.AddInParameter(dbCommand, "VPN", DbType.String, this.VPN);
            db.AddInParameter(dbCommand, "邮件服务", DbType.String, this.邮件服务);
            db.AddInParameter(dbCommand, "网站服务", DbType.String, this.网站服务);
            db.AddInParameter(dbCommand, "打印机", DbType.String, this.打印机);
            db.AddInParameter(dbCommand, "复印机", DbType.String, this.复印机);
            db.AddInParameter(dbCommand, "扫描仪", DbType.String, this.扫描仪);
            db.AddInParameter(dbCommand, "其他要求", DbType.String, this.其他要求);
            db.AddInParameter(dbCommand, "五八小时服务", DbType.String, this.五八小时服务);
            if (this.应急响应次数 == null)
            {
                db.AddInParameter(dbCommand, "应急响应次数", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "应急响应次数", DbType.Int32, this.应急响应次数.Value);
            }
            db.AddInParameter(dbCommand, "备注", DbType.String, this.备注);
            if (this.负责人 == null)
            {
                db.AddInParameter(dbCommand, "负责人", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "负责人", DbType.Int32, this.负责人.Value);
            }
            if (this.日期时间 == null)
            {
                db.AddInParameter(dbCommand, "日期时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "日期时间", DbType.DateTime, this.日期时间.Value);
            }
            if (this.AppendixID == null)
            {
                db.AddInParameter(dbCommand, "AppendixID", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "AppendixID", DbType.Int32, this.AppendixID.Value);
            }
            db.AddInParameter(dbCommand, "负责人A邮箱", DbType.String, this.负责人A邮箱);
            db.AddInParameter(dbCommand, "负责人B邮箱", DbType.String, this.负责人B邮箱);


            return db.ExecuteNonQuery(dbCommand);

        }





        /// <summary>
        /// 更新一条数据
        /// </summary>
        public override int Update(tbUserEntity entity)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update tb_User set ");
            strSql.Append("[ID]=@ID,[RoleGroup]=@RoleGroup,[UserName]=@UserName,[PWD]=@PWD,[RealName]=@RealName,[sex]=@sex,[DepartmentID]=@DepartmentID,[job]=@job,[State]=@State,[WorkNo]=@WorkNo,[Email]=@Email,[Tel]=@Tel,[MSN]=@MSN,[QQ]=@QQ,[Email2]=@Email2,[MSN2]=@MSN2,[QQ2]=@QQ2,[Remark]=@Remark,[CreateDate]=@CreateDate,[CreateBy]=@CreateBy,[ModifyDate]=@ModifyDate,[ModifyBy]=@ModifyBy,[CompanyName]=@CompanyName,[LawPerson]=@LawPerson,[linkMan]=@linkMan,[Mobile]=@Mobile,[Phone]=@Phone,[FAX]=@FAX,[URL]=@URL,[sendmsgAddress]=@sendmsgAddress,[sendGoodsAddress]=@sendGoodsAddress,[ZIP]=@ZIP,[LastLoginTime]=@LastLoginTime,[LoginNum]=@LoginNum,[linkManMail]=@linkManMail,[公司地址]=@公司地址,[公司邮箱]=@公司邮箱,[服务项目]=@服务项目,[公司规模]=@公司规模,[公司网站]=@公司网站,[负责人A]=@负责人A,[负责人B]=@负责人B,[负责人A电话]=@负责人A电话,[负责人B电话]=@负责人B电话,[负责人A手机]=@负责人A手机,[负责人B手机]=@负责人B手机,[工作时间]=@工作时间,[五天八小时]=@五天八小时,[六天八小时]=@六天八小时,[上班时间]=@上班时间,[下班时间]=@下班时间,[台式电脑]=@台式电脑,[笔记本电脑]=@笔记本电脑,[服务器]=@服务器,[路由器]=@路由器,[集线器]=@集线器,[Moden]=@Moden,[交换机]=@交换机,[电话交换]=@电话交换,[VPN]=@VPN,[邮件服务]=@邮件服务,[网站服务]=@网站服务,[打印机]=@打印机,[复印机]=@复印机,[扫描仪]=@扫描仪,[其他要求]=@其他要求,[五八小时服务]=@五八小时服务,[应急响应次数]=@应急响应次数,[备注]=@备注,[负责人]=@负责人,[日期时间]=@日期时间,[AppendixID]=@AppendixID,[负责人A邮箱]=@负责人A邮箱,[负责人B邮箱]=@负责人B邮箱 ");

            strSql.Append(" where ID=@ID ");
            Database db = GetDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ID", DbType.Int32, entity.ID);
            db.AddInParameter(dbCommand, "RoleGroup", DbType.Int32, entity.RoleGroup);
            db.AddInParameter(dbCommand, "UserName", DbType.String, entity.UserName);
            db.AddInParameter(dbCommand, "PWD", DbType.String, entity.PWD);
            db.AddInParameter(dbCommand, "RealName", DbType.String, entity.RealName);
            db.AddInParameter(dbCommand, "sex", DbType.String, entity.sex);
            if (entity.DepartmentID == null)
            {
                db.AddInParameter(dbCommand, "DepartmentID", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "DepartmentID", DbType.Int32, entity.DepartmentID.Value);
            }
            db.AddInParameter(dbCommand, "job", DbType.String, entity.job);
            db.AddInParameter(dbCommand, "State", DbType.Int32, entity.State);
            db.AddInParameter(dbCommand, "WorkNo", DbType.String, entity.WorkNo);
            db.AddInParameter(dbCommand, "Email", DbType.String, entity.Email);
            db.AddInParameter(dbCommand, "Tel", DbType.String, entity.Tel);
            db.AddInParameter(dbCommand, "MSN", DbType.String, entity.MSN);
            db.AddInParameter(dbCommand, "QQ", DbType.String, entity.QQ);
            db.AddInParameter(dbCommand, "Email2", DbType.String, entity.Email2);
            db.AddInParameter(dbCommand, "MSN2", DbType.String, entity.MSN2);
            db.AddInParameter(dbCommand, "QQ2", DbType.String, entity.QQ2);
            db.AddInParameter(dbCommand, "Remark", DbType.String, entity.Remark);
            if (entity.CreateDate == null)
            {
                db.AddInParameter(dbCommand, "CreateDate", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "CreateDate", DbType.DateTime, entity.CreateDate.Value);
            }
            if (entity.CreateBy == null)
            {
                db.AddInParameter(dbCommand, "CreateBy", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "CreateBy", DbType.Int32, entity.CreateBy.Value);
            }
            if (entity.ModifyDate == null)
            {
                db.AddInParameter(dbCommand, "ModifyDate", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "ModifyDate", DbType.DateTime, entity.ModifyDate.Value);
            }
            if (entity.ModifyBy == null)
            {
                db.AddInParameter(dbCommand, "ModifyBy", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "ModifyBy", DbType.Int32, entity.ModifyBy.Value);
            }
            db.AddInParameter(dbCommand, "CompanyName", DbType.String, entity.CompanyName);
            db.AddInParameter(dbCommand, "LawPerson", DbType.String, entity.LawPerson);
            db.AddInParameter(dbCommand, "linkMan", DbType.String, entity.linkMan);
            db.AddInParameter(dbCommand, "Mobile", DbType.String, entity.Mobile);
            db.AddInParameter(dbCommand, "Phone", DbType.String, entity.Phone);
            db.AddInParameter(dbCommand, "FAX", DbType.String, entity.FAX);
            db.AddInParameter(dbCommand, "URL", DbType.String, entity.URL);
            db.AddInParameter(dbCommand, "sendmsgAddress", DbType.String, entity.sendmsgAddress);
            db.AddInParameter(dbCommand, "sendGoodsAddress", DbType.String, entity.sendGoodsAddress);
            db.AddInParameter(dbCommand, "ZIP", DbType.String, entity.ZIP);
            if (entity.LastLoginTime == null)
            {
                db.AddInParameter(dbCommand, "LastLoginTime", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "LastLoginTime", DbType.DateTime, entity.LastLoginTime.Value);
            }
            if (entity.LoginNum == null)
            {
                db.AddInParameter(dbCommand, "LoginNum", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "LoginNum", DbType.Int32, entity.LoginNum.Value);
            }
            db.AddInParameter(dbCommand, "linkManMail", DbType.String, entity.linkManMail);
            db.AddInParameter(dbCommand, "公司地址", DbType.String, entity.公司地址);
            db.AddInParameter(dbCommand, "公司邮箱", DbType.String, entity.公司邮箱);
            db.AddInParameter(dbCommand, "服务项目", DbType.String, entity.服务项目);
            db.AddInParameter(dbCommand, "公司规模", DbType.String, entity.公司规模);
            db.AddInParameter(dbCommand, "公司网站", DbType.String, entity.公司网站);
            db.AddInParameter(dbCommand, "负责人A", DbType.String, entity.负责人A);
            db.AddInParameter(dbCommand, "负责人B", DbType.String, entity.负责人B);
            db.AddInParameter(dbCommand, "负责人A电话", DbType.String, entity.负责人A电话);
            db.AddInParameter(dbCommand, "负责人B电话", DbType.String, entity.负责人B电话);
            db.AddInParameter(dbCommand, "负责人A手机", DbType.String, entity.负责人A手机);
            db.AddInParameter(dbCommand, "负责人B手机", DbType.String, entity.负责人B手机);
            if (entity.工作时间 == null)
            {
                db.AddInParameter(dbCommand, "工作时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "工作时间", DbType.DateTime, entity.工作时间.Value);
            }
            if (entity.五天八小时 == null)
            {
                db.AddInParameter(dbCommand, "五天八小时", DbType.Decimal, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "五天八小时", DbType.Decimal, entity.五天八小时.Value);
            }
            if (entity.六天八小时 == null)
            {
                db.AddInParameter(dbCommand, "六天八小时", DbType.Decimal, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "六天八小时", DbType.Decimal, entity.六天八小时.Value);
            }
            if (entity.上班时间 == null)
            {
                db.AddInParameter(dbCommand, "上班时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "上班时间", DbType.DateTime, entity.上班时间.Value);
            }
            if (entity.下班时间 == null)
            {
                db.AddInParameter(dbCommand, "下班时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "下班时间", DbType.DateTime, entity.下班时间.Value);
            }
            db.AddInParameter(dbCommand, "台式电脑", DbType.String, entity.台式电脑);
            db.AddInParameter(dbCommand, "笔记本电脑", DbType.String, entity.笔记本电脑);
            db.AddInParameter(dbCommand, "服务器", DbType.String, entity.服务器);
            db.AddInParameter(dbCommand, "路由器", DbType.String, entity.路由器);
            db.AddInParameter(dbCommand, "集线器", DbType.String, entity.集线器);
            db.AddInParameter(dbCommand, "Moden", DbType.String, entity.Moden);
            db.AddInParameter(dbCommand, "交换机", DbType.String, entity.交换机);
            db.AddInParameter(dbCommand, "电话交换", DbType.String, entity.电话交换);
            db.AddInParameter(dbCommand, "VPN", DbType.String, entity.VPN);
            db.AddInParameter(dbCommand, "邮件服务", DbType.String, entity.邮件服务);
            db.AddInParameter(dbCommand, "网站服务", DbType.String, entity.网站服务);
            db.AddInParameter(dbCommand, "打印机", DbType.String, entity.打印机);
            db.AddInParameter(dbCommand, "复印机", DbType.String, entity.复印机);
            db.AddInParameter(dbCommand, "扫描仪", DbType.String, entity.扫描仪);
            db.AddInParameter(dbCommand, "其他要求", DbType.String, entity.其他要求);
            db.AddInParameter(dbCommand, "五八小时服务", DbType.String, entity.五八小时服务);
            if (entity.应急响应次数 == null)
            {
                db.AddInParameter(dbCommand, "应急响应次数", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "应急响应次数", DbType.Int32, entity.应急响应次数.Value);
            }
            db.AddInParameter(dbCommand, "备注", DbType.String, entity.备注);
            if (entity.负责人 == null)
            {
                db.AddInParameter(dbCommand, "负责人", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "负责人", DbType.Int32, entity.负责人.Value);
            }
            if (entity.日期时间 == null)
            {
                db.AddInParameter(dbCommand, "日期时间", DbType.DateTime, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "日期时间", DbType.DateTime, entity.日期时间.Value);
            }
            if (entity.AppendixID == null)
            {
                db.AddInParameter(dbCommand, "AppendixID", DbType.Int32, System.DBNull.Value);
            }
            else
            {
                db.AddInParameter(dbCommand, "AppendixID", DbType.Int32, entity.AppendixID.Value);
            }
            db.AddInParameter(dbCommand, "负责人A邮箱", DbType.String, entity.负责人A邮箱);
            db.AddInParameter(dbCommand, "负责人B邮箱", DbType.String, entity.负责人B邮箱);


            return db.ExecuteNonQuery(dbCommand);

        }







        /// <summary>
        /// 对象实体绑定数据
        ///生成构造为list的构造器
        /// </summary>
        private tbUserEntity ReaderBind(IDataReader dataReader, int seq)
        {
            ITOMMS.Entity.tbUserEntity entity = new ITOMMS.Entity.tbUserEntity();
            entity.SEQNO = seq;
            object obj;
            obj = dataReader["ID"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.ID = (int)obj;
            }
            obj = dataReader["RoleGroup"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.RoleGroup = (int)obj;
            }
            entity.UserName = dataReader["UserName"].ToString();
            entity.PWD = dataReader["PWD"].ToString();
            entity.RealName = dataReader["RealName"].ToString();
            entity.sex = dataReader["sex"].ToString();
            obj = dataReader["DepartmentID"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.DepartmentID = (int)obj;
            }
            entity.job = dataReader["job"].ToString();
            obj = dataReader["State"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.State = (int)obj;
            }
            entity.WorkNo = dataReader["WorkNo"].ToString();
            entity.Email = dataReader["Email"].ToString();
            entity.Tel = dataReader["Tel"].ToString();
            entity.MSN = dataReader["MSN"].ToString();
            entity.QQ = dataReader["QQ"].ToString();
            entity.Email2 = dataReader["Email2"].ToString();
            entity.MSN2 = dataReader["MSN2"].ToString();
            entity.QQ2 = dataReader["QQ2"].ToString();
            entity.Remark = dataReader["Remark"].ToString();
            obj = dataReader["CreateDate"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.CreateDate = (DateTime)obj;
            }
            obj = dataReader["CreateBy"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.CreateBy = (int)obj;
            }
            obj = dataReader["ModifyDate"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.ModifyDate = (DateTime)obj;
            }
            obj = dataReader["ModifyBy"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.ModifyBy = (int)obj;
            }
            entity.CompanyName = dataReader["CompanyName"].ToString();
            entity.LawPerson = dataReader["LawPerson"].ToString();
            entity.linkMan = dataReader["linkMan"].ToString();
            entity.Mobile = dataReader["Mobile"].ToString();
            entity.Phone = dataReader["Phone"].ToString();
            entity.FAX = dataReader["FAX"].ToString();
            entity.URL = dataReader["URL"].ToString();
            entity.sendmsgAddress = dataReader["sendmsgAddress"].ToString();
            entity.sendGoodsAddress = dataReader["sendGoodsAddress"].ToString();
            entity.ZIP = dataReader["ZIP"].ToString();
            obj = dataReader["LastLoginTime"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.LastLoginTime = (DateTime)obj;
            }
            obj = dataReader["LoginNum"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.LoginNum = (int)obj;
            }
            entity.linkManMail = dataReader["linkManMail"].ToString();
            entity.公司地址 = dataReader["公司地址"].ToString();
            entity.公司邮箱 = dataReader["公司邮箱"].ToString();
            entity.服务项目 = dataReader["服务项目"].ToString();
            entity.公司规模 = dataReader["公司规模"].ToString();
            entity.公司网站 = dataReader["公司网站"].ToString();
            entity.负责人A = dataReader["负责人A"].ToString();
            entity.负责人B = dataReader["负责人B"].ToString();
            entity.负责人A电话 = dataReader["负责人A电话"].ToString();
            entity.负责人B电话 = dataReader["负责人B电话"].ToString();
            entity.负责人A手机 = dataReader["负责人A手机"].ToString();
            entity.负责人B手机 = dataReader["负责人B手机"].ToString();
            obj = dataReader["工作时间"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.工作时间 = (DateTime)obj;
            }
            obj = dataReader["五天八小时"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.五天八小时 = (bool)obj;
            }
            obj = dataReader["六天八小时"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.六天八小时 = (bool)obj;
            }
            obj = dataReader["上班时间"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.上班时间 = (DateTime)obj;
            }
            obj = dataReader["下班时间"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.下班时间 = (DateTime)obj;
            }
            entity.台式电脑 = dataReader["台式电脑"].ToString();
            entity.笔记本电脑 = dataReader["笔记本电脑"].ToString();
            entity.服务器 = dataReader["服务器"].ToString();
            entity.路由器 = dataReader["路由器"].ToString();
            entity.集线器 = dataReader["集线器"].ToString();
            entity.Moden = dataReader["Moden"].ToString();
            entity.交换机 = dataReader["交换机"].ToString();
            entity.电话交换 = dataReader["电话交换"].ToString();
            entity.VPN = dataReader["VPN"].ToString();
            entity.邮件服务 = dataReader["邮件服务"].ToString();
            entity.网站服务 = dataReader["网站服务"].ToString();
            entity.打印机 = dataReader["打印机"].ToString();
            entity.复印机 = dataReader["复印机"].ToString();
            entity.扫描仪 = dataReader["扫描仪"].ToString();
            entity.其他要求 = dataReader["其他要求"].ToString();
            entity.五八小时服务 = dataReader["五八小时服务"].ToString();
            obj = dataReader["应急响应次数"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.应急响应次数 = (int)obj;
            }
            entity.备注 = dataReader["备注"].ToString();
            obj = dataReader["负责人"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.负责人 = (int)obj;
            }
            obj = dataReader["日期时间"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.日期时间 = (DateTime)obj;
            }
            obj = dataReader["AppendixID"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.AppendixID = (int)obj;
            }
            entity.负责人A邮箱 = dataReader["负责人A邮箱"].ToString();
            entity.负责人B邮箱 = dataReader["负责人B邮箱"].ToString();

            return entity;
        }


        /// <summary>
        /// 对象实体绑定数据
        ///生成构造为list的构造器
        /// </summary>
        private tbUserEntity ReaderBind(IDataReader dataReader)
        {
            ITOMMS.Entity.tbUserEntity entity = new ITOMMS.Entity.tbUserEntity();
            object obj;
            obj = dataReader["ID"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.ID = (int)obj;
            }
            obj = dataReader["RoleGroup"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.RoleGroup = (int)obj;
            }
            entity.UserName = dataReader["UserName"].ToString();
            entity.PWD = dataReader["PWD"].ToString();
            entity.RealName = dataReader["RealName"].ToString();
            entity.sex = dataReader["sex"].ToString();
            obj = dataReader["DepartmentID"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.DepartmentID = (int)obj;
            }
            entity.job = dataReader["job"].ToString();
            obj = dataReader["State"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.State = (int)obj;
            }
            entity.WorkNo = dataReader["WorkNo"].ToString();
            entity.Email = dataReader["Email"].ToString();
            entity.Tel = dataReader["Tel"].ToString();
            entity.MSN = dataReader["MSN"].ToString();
            entity.QQ = dataReader["QQ"].ToString();
            entity.Email2 = dataReader["Email2"].ToString();
            entity.MSN2 = dataReader["MSN2"].ToString();
            entity.QQ2 = dataReader["QQ2"].ToString();
            entity.Remark = dataReader["Remark"].ToString();
            obj = dataReader["CreateDate"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.CreateDate = (DateTime)obj;
            }
            obj = dataReader["CreateBy"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.CreateBy = (int)obj;
            }
            obj = dataReader["ModifyDate"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.ModifyDate = (DateTime)obj;
            }
            obj = dataReader["ModifyBy"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.ModifyBy = (int)obj;
            }
            entity.CompanyName = dataReader["CompanyName"].ToString();
            entity.LawPerson = dataReader["LawPerson"].ToString();
            entity.linkMan = dataReader["linkMan"].ToString();
            entity.Mobile = dataReader["Mobile"].ToString();
            entity.Phone = dataReader["Phone"].ToString();
            entity.FAX = dataReader["FAX"].ToString();
            entity.URL = dataReader["URL"].ToString();
            entity.sendmsgAddress = dataReader["sendmsgAddress"].ToString();
            entity.sendGoodsAddress = dataReader["sendGoodsAddress"].ToString();
            entity.ZIP = dataReader["ZIP"].ToString();
            obj = dataReader["LastLoginTime"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.LastLoginTime = (DateTime)obj;
            }
            obj = dataReader["LoginNum"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.LoginNum = (int)obj;
            }
            entity.linkManMail = dataReader["linkManMail"].ToString();
            entity.公司地址 = dataReader["公司地址"].ToString();
            entity.公司邮箱 = dataReader["公司邮箱"].ToString();
            entity.服务项目 = dataReader["服务项目"].ToString();
            entity.公司规模 = dataReader["公司规模"].ToString();
            entity.公司网站 = dataReader["公司网站"].ToString();
            entity.负责人A = dataReader["负责人A"].ToString();
            entity.负责人B = dataReader["负责人B"].ToString();
            entity.负责人A电话 = dataReader["负责人A电话"].ToString();
            entity.负责人B电话 = dataReader["负责人B电话"].ToString();
            entity.负责人A手机 = dataReader["负责人A手机"].ToString();
            entity.负责人B手机 = dataReader["负责人B手机"].ToString();
            obj = dataReader["工作时间"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.工作时间 = (DateTime)obj;
            }
            obj = dataReader["五天八小时"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.五天八小时 = (bool)obj;
            }
            obj = dataReader["六天八小时"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.六天八小时 = (bool)obj;
            }
            obj = dataReader["上班时间"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.上班时间 = (DateTime)obj;
            }
            obj = dataReader["下班时间"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.下班时间 = (DateTime)obj;
            }
            entity.台式电脑 = dataReader["台式电脑"].ToString();
            entity.笔记本电脑 = dataReader["笔记本电脑"].ToString();
            entity.服务器 = dataReader["服务器"].ToString();
            entity.路由器 = dataReader["路由器"].ToString();
            entity.集线器 = dataReader["集线器"].ToString();
            entity.Moden = dataReader["Moden"].ToString();
            entity.交换机 = dataReader["交换机"].ToString();
            entity.电话交换 = dataReader["电话交换"].ToString();
            entity.VPN = dataReader["VPN"].ToString();
            entity.邮件服务 = dataReader["邮件服务"].ToString();
            entity.网站服务 = dataReader["网站服务"].ToString();
            entity.打印机 = dataReader["打印机"].ToString();
            entity.复印机 = dataReader["复印机"].ToString();
            entity.扫描仪 = dataReader["扫描仪"].ToString();
            entity.其他要求 = dataReader["其他要求"].ToString();
            entity.五八小时服务 = dataReader["五八小时服务"].ToString();
            obj = dataReader["应急响应次数"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.应急响应次数 = (int)obj;
            }
            entity.备注 = dataReader["备注"].ToString();
            obj = dataReader["负责人"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.负责人 = (int)obj;
            }
            obj = dataReader["日期时间"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.日期时间 = (DateTime)obj;
            }
            obj = dataReader["AppendixID"];
            if (obj != null && obj != DBNull.Value)
            {
                entity.AppendixID = (int)obj;
            }
            entity.负责人A邮箱 = dataReader["负责人A邮箱"].ToString();
            entity.负责人B邮箱 = dataReader["负责人B邮箱"].ToString();

            return entity;
        }



        #endregion

    }
}
